# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.676.12.13 -> 1.676.12.14 # arch/ia64/kernel/perfmon.c 1.8 -> 1.9 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 02/09/27 eranian@hpl.hp.com 1.676.12.14 # ia64: Fix perfmon error path leaks. # -------------------------------------------- # diff -Nru a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c --- a/arch/ia64/kernel/perfmon.c Wed Oct 8 09:09:21 2003 +++ b/arch/ia64/kernel/perfmon.c Wed Oct 8 09:09:21 2003 @@ -767,15 +767,14 @@ psb = kmalloc(sizeof(*psb), GFP_KERNEL); if (psb == NULL) { DBprintk(("Can't allocate sampling buffer descriptor\n")); - pfm_rvfree(smpl_buf, size); - return -ENOMEM; + goto error_kmalloc; } /* allocate vma */ vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL); if (!vma) { DBprintk(("Cannot allocate vma\n")); - goto error; + goto error_kmem; } /* * partially initialize the vma for the sampling buffer @@ -875,8 +874,11 @@ return 0; error: - pfm_rvfree(smpl_buf, size); + kmem_cache_free(vm_area_cachep, vma); +error_kmem: kfree(psb); +error_kmalloc: + pfm_rvfree(smpl_buf, size); return -ENOMEM; }